package springRepo.Library.domain.book;

public class Book {
	
	private String name;
	
	private String author;
	
	public Book(){}
	
	public Book(String name, String author){
		this.name = name;
		this.author = author;
	}
	
	public String getName(){
		return name;
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getAuthor(){
		return author;
	}
	
	public void setAuthor(String author){
		this.author = author;
	}
	
	@Override
	public int hashCode(){
		int hash = 17;
		hash = 23 * hash + (name == null ? 0 : name.hashCode());
		hash = 23 * hash + (author == null ? 0 : author.hashCode());
		return hash;
	}
	
	@Override
	public boolean equals(Object obj){
		if(obj == null) return false;
		if(this == obj) return true;
		if(!(obj instanceof Book)) return false;
		
		Book arg = (Book) obj;
		return name.equals(arg.name) &&
				author.equals(arg.author);
	}
	
	@Override
	public String toString(){
		return "Book { Name : " + name + ", Author : " + author + " }";
	}
}
